import request from '@/utils/request'

// 查询库存预警列表
export function listWarning(query) {
    return request({
        url: '/system/warning/list',
        method: 'get',
        params: query
    })
}

// 查询库存预警详细
export function getWarning(id) {
    return request({
        url: '/system/warning/' + id,
        method: 'get'
    })
}

// 新增库存预警
export function addWarning(data) {
    return request({
        url: '/system/warning',
        method: 'post',
        data: data
    })
}

// 修改库存预警
export function updateWarning(data) {
    return request({
        url: '/system/warning',
        method: 'put',
        data: data
    })
}

// 删除库存预警
export function delWarning(id) {
    return request({
        url: '/system/warning/' + id,
        method: 'delete'
    })
}

// 导出库存预警
export function exportWarning(query) {
    return request({
        url: '/system/warning/export',
        method: 'get',
        params: query
    })
}

// 处理库存预警
export function handleWarning(data) {
    return request({
        url: '/system/warning/handle',
        method: 'put',
        data: data
    })
}

// 忽略库存预警
export function ignoreWarning(data) {
    return request({
        url: '/system/warning/ignore',
        method: 'put',
        data: data
    })
}

// 查询预警统计
export function getWarningStats() {
    return request({
        url: '/system/warning/stats',
        method: 'get'
    })
}